package com.exam.controller;

import com.exam.service.AppManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("appManager")
public class AppManagerController {

    @Autowired
    AppManagerService appManagerService;

    @ResponseBody
    @PostMapping("bindUser")
    public Map<String, String> bindUser(HttpServletRequest request) {
        String result = appManagerService.saveUser(request);
        Map<String, String> mp = new HashMap<>();
        mp.put("status", result);
        return mp;
    }
}
